<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/WEB-INF/tld/tags.tld"  prefix="t" %>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="style/main.css">
    <title>Admissions. Catalog input marks</title>
</head>
<body>
<table class="tableBody">
    <tr>
        <td colspan="3">
            <t:header/>
        </td>
    </tr>
    <tr style="vertical-align: top">
        <td class="foot">
            <t:menu roleUser="${sessionScope.userRole}"/></td>
        <td style="background: #2c6932; width: 2px"/>
        <td style="width: 900px">
            <form name="inputMrk" action="controller" method="post">
                <c:set var="number" value="1"/>
                <table class="tableView">
                    <tr class="tableHeaderRow">
                        <td>№</td>
                        <td>Specialty</td>
                        <td>History KZ</td>
                        <td>Language</td>
                        <td>Mathematics</td>
                        <td>Elective</td>
                        <td>Mark</td>
                        <td>Delete</td>
                    </tr>
                    <c:forEach var="inputMrks" items="${requestScope.inputMarks}">
                        <tr>
                            <td>${number}<input type="hidden" name="idInputMark" value="${inputMrks.id}"></td>
                            <td>
                                <c:set var="selectSpecialty" value="${inputMrks.specialty}"/>
                                <select name="changeSpecialty">
                                    <option>-</option>
                                    <c:forEach var="specialty" items="${requestScope.specialties}">
                                        <option value="${specialty.code}" ${specialty.name == selectSpecialty.name ? 'selected' : ''}>${specialty.code}-${specialty.name}</option>
                                    </c:forEach>
                                </select>
                            </td>
                            <td>
                                <input type="text" value="${inputMrks.historyKZMark}" name="changeHistoryKZMark"
                                       style="width: 50px">
                            </td>
                            <td>
                                <input type="text" value="${inputMrks.languageMark}" name="changeLanguageMark"
                                       style="width: 50px">
                            </td>
                            <td>
                                <input type="text" value="${inputMrks.mathematicsMark}" name="changeMathematicsMark"
                                       style="width: 50px">
                            </td>
                            <td>
                                <c:set var="selectSubject" value="${inputMrks.subject}"/>
                                <select name="changeSbject">
                                    <option>-</option>
                                    <c:forEach var="sbject" items="${requestScope.subjects}">
                                        <option value="${sbject.name}" ${sbject.name == selectSubject.name ? 'selected' : ''}>${sbject.name}</option>
                                    </c:forEach>
                                </select>
                            </td>
                            <td>
                                <input type="text" value="${inputMrks.mark}" name="changeMark" style="width: 50px">
                            </td>
                            <td><input type="checkbox" value="${inputMrks.id}" name="checkbox"/></td>
                        </tr>
                        <c:set var="number" value="${number+1}"/>
                    </c:forEach>
                    <tr>
                        <td></td>
                        <td>
                            <select name="newSpecialty">
                                <option>-</option>
                                <c:forEach var="specialt" items="${requestScope.specialties}">
                                    <option>${specialt.code}-${specialt.name}</option>
                                </c:forEach>
                            </select>
                        </td>
                        <td><input type="text" name="newHistoryKZMark" style="width: 50px"></td>
                        <td><input type="text" name="newLanguageMark" style="width: 50px"></td>
                        <td><input type="text" name="newMathematicsMark" style="width: 50px"></td>
                        <td>
                            <select name="newSubject">
                                <option>-</option>
                                <c:forEach var="subject" items="${requestScope.subjects}">
                                    <option>${subject.name}</option>
                                </c:forEach>
                            </select>
                        </td>
                        <td colspan="2"><input type="text" name="newMark" style="width: 50px"></td>
                    </tr>
                    <tr>
                        <td colspan="8" style="text-align: left">
                            <input type="hidden" name="action" value="saveInputMarks">
                            <input type="submit" value="Save" name="submit" class="commandButton">
                        </td>
                    </tr>
                </table>
            </form>
        </td>
    </tr>
    <tr>
        <td colspan="3">
            <t:footer/>
        </td>
    </tr>
</table>
</body>
</html>